/**
 * 功能:TK_WAREHOUSE_ACCOUNTS Dao类
 * 开发人员:chengd
 * 创建时间:2012/4/23 19:33:09
 */
package com.towker.frame.dao.warehouse;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import org.springframework.stereotype.Repository;

import com.towker.core.db.BaseDao;
import com.towker.frame.model.warehouse.WarehouseAccounts;

@Repository
@SuppressWarnings("unchecked")
public class WarehouseAccountsDao extends BaseDao<WarehouseAccounts, Long>
{
	@Override
	public Class getEntityClass()
	{
		return WarehouseAccounts.class;
	}
	
	public WarehouseAccounts getByDepotAndGoods(String goodsSn, String depotCode, String coCode) {
		String statementName = getIbatisMapperNamespace() + ".getByDepotAndGoods";
		Map params = new TreeMap<String, Object>();
		params.put("dep_code", depotCode);
		params.put("goods_sn", goodsSn);
		params.put("co_code", coCode);
		List<WarehouseAccounts> warehouseAccounts = getSqlSessionTemplate().selectList(statementName, params);
		if (warehouseAccounts.size() > 0) {
			return warehouseAccounts.get(0);
		}
		return null;
	}
}